<?php if(!class_exists('raintpl')){exit;}?><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="http://localhost/kpi/html/style.css" rel="stylesheet" type="text/css" media = "screen">
<link href="http://localhost/kpi/html/print.css" rel="stylesheet" type="text/css" media = "print">

</head>
<body>
<div id = "wrapper">

<div id = "container">
	<h1 class = "header">รายงานผลการประเมิน</h1>
	<br>
	<div class = "center" id = "report">
		<button class="print" onclick="javascript:window.print()">พิมพ์รายงาน</button>
		<h2>รายงานเปรียบเทียบคะแนนรวมองค์ประกอบแต่ละปี</h2>
		<table cellpadding = "0" cellspacing = "0" border = "0" class = "list">
			<tr>
				<th class = "w300">องค์ประกอบ</td>
				<?php $counter1=-1; if( isset($year_range) && is_array($year_range) && sizeof($year_range) ) foreach( $year_range as $key1 => $value1 ){ $counter1++; ?>
				<th class = "w70">พ.ศ. <?php echo $value1["year"];?></td>
				<?php } ?>
			</tr>
			<?php $counter1=-1; if( isset($group) && is_array($group) && sizeof($group) ) foreach( $group as $key1 => $value1 ){ $counter1++; ?>
			<tr>
				<td><?php echo $value1["name"];?></td>
				<?php $counter2=-1; if( isset($year_range) && is_array($year_range) && sizeof($year_range) ) foreach( $year_range as $key2 => $value2 ){ $counter2++; ?>
					<td>
						<?php if( $value2['total'][$key1+1]=='' ){ ?>
							0
						<?php }else{ ?>
							<?php echo $value2['total'][$key1+1];?>
						<?php } ?>
					</td>
				<?php } ?>
			</tr>
			<?php } ?>
			<tr>
				<td class = "head">รวม</td>
				<?php $counter1=-1; if( isset($year_range) && is_array($year_range) && sizeof($year_range) ) foreach( $year_range as $key1 => $value1 ){ $counter1++; ?>
					<td><b><?php echo $value1["grand_total"];?></b></td>
				<?php } ?>
			</tr>
		</table>
	</div>

	<div class = "clear"></div>
</div>

</div> <!-- wrapper -->

</body>
</html>